package com.zlq.login.service;

import com.zlq.login.dao.UserDao;
import com.zlq.login.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserService {
    @Resource
    private UserDao userDao;

    public void save(User user){
        userDao.save(user);
    }

    public void update(User user){
        userDao.update(user);
    }

    public List<User> getAll() {
        return userDao.getAll();
    }

    public User selectById(Integer id) {
        return userDao.getById(id);
    }
    public User selectByName(String name){
            return userDao.selectByName(name);

    }
    public int  delete(Integer id){
        return  userDao.delete(id);
    }
    public List<User> selectByPage(int numpage, int size){
        return userDao.selectByPage(numpage,size);
    }
    public int selectCount(){
        return userDao.getTotalCount();
    }
    public List<User> selectByLike(String str){
        return userDao.selectByLike(str);
    }
}
